Dynomotion

Group: DynoMotion Message: 4190 From: dotma99 Date: 3/7/2012
Subject: Simultaneous commands
Hi Tom

I have just bought a kflop and kanalog and am very impressed so far.

A question. I have built a machine for a specialised drilling process and I want to be able to move my Z axis down, while simultaneously starting a program which starts a sequence of firing two solenoids. Control needs to returned to the G code program on completion of the solenoid program, not the Z move.

I have looked at the NotifyTapMach3 v2.c example which has some clues, but I am not knowledgeable enough to extrapolate that to my application.

Could you give me some help with this?

thanks in advance

Edward
Group: DynoMotion Message: 4192 From: Tom Kerekes Date: 3/7/2012
Subject: Re: Simultaneous commands
Hi Edward,
 
I assume you wish to use Mach3?
 
I think you may need to use a Virtual IO bit to force Mach3 to wait until your sequence is complete.
 
It sounds like an approach as follows may work:
 
Configure Mach3 Ports&Pins Input #1 as Port1 Bit48
 
 
Define a VB Mcode M180
      NotifyPlugins(10080)   'this will tell KFLOP to clear a virtual bit #48 and start Solenoid Sequence
 
Define a VB MCode M181
      while(IsActive(1))
          Sleep(10)
      end while
   
 
KFLOP Notify program:
------------------------------
 
if (msg==10080)
{
    SetBit(48);  // signal we are busy
    
    SetBit(XXX);  // solenoid on
    Delay_sec(5);
    ClearBit(XXX); // solenoid off
   
    ClearBit(48); // signal we are done
}
 
In GCode
------------
M180
G1Z1F10
M181
 
 
Let me know how much of this makes sense
 
Regards
TK
 
 
 
 
 

From: dotma99 <edward@...>
To: DynoMotion@yahoogroups.com
Sent: Wednesday, March 7, 2012 5:06 AM
Subject: [DynoMotion] Simultaneous commands

 
Hi Tom

I have just bought a kflop and kanalog and am very impressed so far.

A question. I have built a machine for a specialised drilling process and I want to be able to move my Z axis down, while simultaneously starting a program which starts a sequence of firing two solenoids. Control needs to returned to the G code program on completion of the solenoid program, not the Z move.

I have looked at the NotifyTapMach3 v2.c example which has some clues, but I am not knowledgeable enough to extrapolate that to my application.

Could you give me some help with this?

thanks in advance

Edward



Group: DynoMotion Message: 4193 From: Edward Forwood Date: 3/7/2012
Subject: Re: Simultaneous commands

Hi Tom

 

Thanks, but I am using KmotionCNC (apologies, I should have said so).  I am not quite clear how to implement in Kmotioncnc.  Presumably it’s a bit easier?  The machine is designed to drill at 4 holes plus per second so timing is important!  Just to confirm the solenoid sequence needs to start at the same time as the z axis starts to move.

 

Best regards

 

Edward

 

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
Sent: 07 March 2012 16:29
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Simultaneous commands

 

 

Hi Edward,

 

I assume you wish to use Mach3?

 

I think you may need to use a Virtual IO bit to force Mach3 to wait until your sequence is complete.

 

It sounds like an approach as follows may work:

 

Configure Mach3 Ports&Pins Input #1 as Port1 Bit48

 

 

Define a VB Mcode M180

      NotifyPlugins(10080)   'this will tell KFLOP to clear a virtual bit #48 and start Solenoid Sequence

 

Define a VB MCode M181

      while(IsActive(1))

          Sleep(10)

      end while

   

 

KFLOP Notify program:

------------------------------

 

if (msg==10080)

{

    SetBit(48);  // signal we are busy

    

    SetBit(XXX);  // solenoid on

    Delay_sec(5);

    ClearBit(XXX); // solenoid off

   

    ClearBit(48); // signal we are done

}

 

In GCode

------------

M180

G1Z1F10

M181

 

 

Let me know how much of this makes sense

 

Regards

TK

 

 

 

 

 

 

From: dotma99 <edward@...>
To: DynoMotion@yahoogroups.com
Sent: Wednesday, March 7, 2012 5:06 AM
Subject: [DynoMotion] Simultaneous commands

 

 

Hi Tom

I have just bought a kflop and kanalog and am very impressed so far.

A question. I have built a machine for a specialised drilling process and I want to be able to move my Z axis down, while simultaneously starting a program which starts a sequence of firing two solenoids. Control needs to returned to the G code program on completion of the solenoid program, not the Z move.

I have looked at the NotifyTapMach3 v2.c example which has some clues, but I am not knowledgeable enough to extrapolate that to my application.

Could you give me some help with this?

thanks in advance

Edward

 

Group: DynoMotion Message: 4195 From: Tom Kerekes Date: 3/7/2012
Subject: Re: Simultaneous commands
Hi Edward,
 
In this case it would probably be better to have the GCode Set a Virtual IO bit that an already running C program could detect to start the solenoid sequence.  In KMotionCNC there is a way to insert buffered IO commands into the motion buffer that will happen in exact sync with the motion.  So for example in GCode:
 
 
(BUF,SetBitBuf48);
G1 Z-1 F10
(BUF,ClearBitBuf48)
 
 
Then in KFLOP C code
 
for(;;) // loop forever
{
    while (!ReadBit(48)) ;  // wait for signal
 
    SetBit(XX);  // solenoid on
    Delay_sec(0.1);
    ClearBit(XX); //solenoid off
 
    while (!ReadBit(48));  // wait for signal to reset
}
 
 
The C code loop might be added to the end of your Init.c program

Regards
TK
 
 
From: Edward Forwood <edward@...>
To: DynoMotion@yahoogroups.com
Sent: Wednesday, March 7, 2012 9:12 AM
Subject: RE: [DynoMotion] Simultaneous commands

 
Hi Tom
 
Thanks, but I am using KmotionCNC (apologies, I should have said so).  I am not quite clear how to implement in Kmotioncnc.  Presumably it’s a bit easier?  The machine is designed to drill at 4 holes plus per second so timing is important!  Just to confirm the solenoid sequence needs to start at the same time as the z axis starts to move.
 
Best regards
 
Edward
 
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
Sent: 07 March 2012 16:29
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Simultaneous commands
 
 
Hi Edward,
 
I assume you wish to use Mach3?
 
I think you may need to use a Virtual IO bit to force Mach3 to wait until your sequence is complete.
 
It sounds like an approach as follows may work:
 
Configure Mach3 Ports&Pins Input #1 as Port1 Bit48
 
 
Define a VB Mcode M180
      NotifyPlugins(10080)   'this will tell KFLOP to clear a virtual bit #48 and start Solenoid Sequence
 
Define a VB MCode M181
      while(IsActive(1))
          Sleep(10)
      end while
   
 
KFLOP Notify program:
------------------------------
 
if (msg==10080)
{
    SetBit(48);  // signal we are busy
    
    SetBit(XXX);  // solenoid on
    Delay_sec(5);
    ClearBit(XXX); // solenoid off
   
    ClearBit(48); // signal we are done
}
 
In GCode
------------
M180
G1Z1F10
M181
 
 
Let me know how much of this makes sense
 
Regards
TK
 
 
 
 
 
 
From: dotma99 <edward@...>
To: DynoMotion@yahoogroups.com
Sent: Wednesday, March 7, 2012 5:06 AM
Subject: [DynoMotion] Simultaneous commands
 
 
Hi Tom

I have just bought a kflop and kanalog and am very impressed so far.

A question. I have built a machine for a specialised drilling process and I want to be able to move my Z axis down, while simultaneously starting a program which starts a sequence of firing two solenoids. Control needs to returned to the G code program on completion of the solenoid program, not the Z move.

I have looked at the NotifyTapMach3 v2.c example which has some clues, but I am not knowledgeable enough to extrapolate that to my application.

Could you give me some help with this?

thanks in advance

Edward
 


Group: DynoMotion Message: 4205 From: dotma99 Date: 3/10/2012
Subject: Re: Simultaneous commands
Hi Tom

Thanks for that response. Another simple question. Is there a way of triggering a command like "ClearBit154" as soon as Feed Hold or Stop is pressed in KmotionCNC?

best

Edward

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Edward,
>  
> In this case it would probably be better to have the GCode Set a Virtual IO bit that an already running C program could detect to start the solenoid sequence.  In KMotionCNC there is a way to insert buffered IO commands into the motion buffer that will happen in exact sync with the motion.  So for example in GCode:
>  
>  
> (BUF,SetBitBuf48);
> G1 Z-1 F10
> (BUF,ClearBitBuf48)
>  
>  
> Then in KFLOP C code
>  
> for(;;) // loop forever
> {
>     while (!ReadBit(48)) ;  // wait for signal
>  
>     SetBit(XX);  // solenoid on
>     Delay_sec(0.1);
>     ClearBit(XX); //solenoid off
>  
>     while (!ReadBit(48));  // wait for signal to reset
> }
>  
>  
> The C code loop might be added to the end of your Init.c program
>
> Regards
> TK
>  
>  
>
> ________________________________
> From: Edward Forwood <edward@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, March 7, 2012 9:12 AM
> Subject: RE: [DynoMotion] Simultaneous commands
>
>
>
>  
>
> Hi Tom
>  
> Thanks, but I am using KmotionCNC (apologies, I should have said so).  I am not quite clear how to implement in Kmotioncnc.  Presumably it’s a bit easier?  The machine is designed to drill at 4 holes plus per second so timing is important!  Just to confirm the solenoid sequence needs to start at the same time as the z axis starts to move.
>  
> Best regards
>  
> Edward
>  
> From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> Sent: 07 March 2012 16:29
> To: DynoMotion@yahoogroups.com
> Subject: Re: [DynoMotion] Simultaneous commands
>  
>  
> Hi Edward,
>  
> I assume you wish to use Mach3?
>  
> I think you may need to use a Virtual IO bit to force Mach3 to wait until your sequence is complete.
>  
> It sounds like an approach as follows may work:
>  
> Configure Mach3 Ports&Pins Input #1 as Port1 Bit48
>  
>  
> Define a VB Mcode M180
>       NotifyPlugins(10080)   'this will tell KFLOP to clear a virtual bit #48 and start Solenoid Sequence
>  
> Define a VB MCode M181
>       while(IsActive(1))
>           Sleep(10)
>       end while
>    
>  
> KFLOP Notify program:
> ------------------------------
>  
> if (msg==10080)
> {
>     SetBit(48);  // signal we are busy
>     
>     SetBit(XXX);  // solenoid on
>     Delay_sec(5);
>     ClearBit(XXX); // solenoid off
>    
>     ClearBit(48); // signal we are done
> }
>  
> In GCode
> ------------
> M180
> G1Z1F10
> M181
>  
>  
> Let me know how much of this makes sense
>  
> Regards
> TK
>  
>  
>  
>  
>  
>  
> From:dotma99 <edward@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, March 7, 2012 5:06 AM
> Subject: [DynoMotion] Simultaneous commands
>  
>  
> Hi Tom
>
> I have just bought a kflop and kanalog and am very impressed so far.
>
> A question. I have built a machine for a specialised drilling process and I want to be able to move my Z axis down, while simultaneously starting a program which starts a sequence of firing two solenoids. Control needs to returned to the G code program on completion of the solenoid program, not the Z move.
>
> I have looked at the NotifyTapMach3 v2.c example which has some clues, but I am not knowledgeable enough to extrapolate that to my application.
>
> Could you give me some help with this?
>
> thanks in advance
>
> Edward
>  
>
Group: DynoMotion Message: 4206 From: TK Date: 3/10/2012
Subject: Re: Simultaneous commands
Not directly. You would need to write a c program to monitor the Stop Status or Axis Enables. 

TK

On Mar 10, 2012, at 7:47 AM, "dotma99" <edward@...> wrote:

 

Hi Tom

Thanks for that response. Another simple question. Is there a way of triggering a command like "ClearBit154" as soon as Feed Hold or Stop is pressed in KmotionCNC?

best

Edward

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Edward,
>  
> In this case it would probably be better to have the GCode Set a Virtual IO bit that an already running C program could detect to start the solenoid sequence.  In KMotionCNC there is a way to insert buffered IO commands into the motion buffer that will happen in exact sync with the motion.  So for example in GCode:
>  
>  
> (BUF,SetBitBuf48);
> G1 Z-1 F10
> (BUF,ClearBitBuf48)
>  
>  
> Then in KFLOP C code
>  
> for(;;) // loop forever
> {
>     while (!ReadBit(48)) ;  // wait for signal
>  
>     SetBit(XX);  // solenoid on
>     Delay_sec(0.1);
>     ClearBit(XX); //solenoid off
>  
>     while (!ReadBit(48));  // wait for signal to reset
> }
>  
>  
> The C code loop might be added to the end of your Init.c program
>
> Regards
> TK
>  
>  
>
> ________________________________
> From: Edward Forwood <edward@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, March 7, 2012 9:12 AM
> Subject: RE: [DynoMotion] Simultaneous commands
>
>
>
>  
>
> Hi Tom
>  
> Thanks, but I am using KmotionCNC (apologies, I should have said so).  I am not quite clear how to implement in Kmotioncnc.  Presumably it’s a bit easier?  The machine is designed to drill at 4 holes plus per second so timing is important!  Just to confirm the solenoid sequence needs to start at the same time as the z axis starts to move.
>  
> Best regards
>  
> Edward
>  
> From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> Sent: 07 March 2012 16:29
> To: DynoMotion@yahoogroups.com
> Subject: Re: [DynoMotion] Simultaneous commands
>  
>  
> Hi Edward,
>  
> I assume you wish to use Mach3?
>  
> I think you may need to use a Virtual IO bit to force Mach3 to wait until your sequence is complete.
>  
> It sounds like an approach as follows may work:
>  
> Configure Mach3 Ports&Pins Input #1 as Port1 Bit48
>  
>  
> Define a VB Mcode M180
>       NotifyPlugins(10080)   'this will tell KFLOP to clear a virtual bit #48 and start Solenoid Sequence
>  
> Define a VB MCode M181
>       while(IsActive(1))
>           Sleep(10)
>       end while
>    
>  
> KFLOP Notify program:
> ------------------------------
>  
> if (msg==10080)
> {
>     SetBit(48);  // signal we are busy
>     
>     SetBit(XXX);  // solenoid on
>     Delay_sec(5);
>     ClearBit(XXX); // solenoid off
>    
>     ClearBit(48); // signal we are done
> }
>  
> In GCode
> ------------
> M180
> G1Z1F10
> M181
>  
>  
> Let me know how much of this makes sense
>  
> Regards
> TK
>  
>  
>  
>  
>  
>  
> From:dotma99 <edward@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, March 7, 2012 5:06 AM
> Subject: [DynoMotion] Simultaneous commands
>  
>  
> Hi Tom
>
> I have just bought a kflop and kanalog and am very impressed so far.
>
> A question. I have built a machine for a specialised drilling process and I want to be able to move my Z axis down, while simultaneously starting a program which starts a sequence of firing two solenoids. Control needs to returned to the G code program on completion of the solenoid program, not the Z move.
>
> I have looked at the NotifyTapMach3 v2.c example which has some clues, but I am not knowledgeable enough to extrapolate that to my application.
>
> Could you give me some help with this?
>
> thanks in advance
>
> Edward
>  
>